package com.zatech.cgnci.project.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 理赔任务类型
 */
@Getter
@AllArgsConstructor
public enum ClaimTaskTypeEnum {
    FILING("1", "立案"),
    RESERVES_PROVISION("2", "准备金计提"),
    RESERVES_ADJUST("3", "准备金调整"),
    PREPAY("4", "预付申请"),
    CLOSE("5", "结案申请"),
    REOPEN("6", "重开申请"),
    ;

    public static ClaimTaskTypeEnum getEnumByCode(String code) {
        return Arrays.stream(values()).filter(e -> Objects.equals(e.getCode(), code)).findAny().orElse(null);
    }

    private String code;
    private String name;
}
